#define _CRT_SECURE_NO_WARNINGS 1
#include"AVLtree.h"
#include<vector>
#include<time.h>


void test1()
{
	jxm::AVLTree<int, int>dict;
	//int a[] = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };
	int a[] = { 4, 2,2,6, 1, 3, 5, 15, 7, 16, 14 };
	for (auto e : a)
	{
		dict.insert({ e,e });
	}
	dict.Inorde();
	cout << dict.high() << endl;
	cout<<dict.isbalancetree()<<endl;
	dict.find(100);
}

void test2()
{
	int n = 100000;
	jxm::AVLTree<int, int>T;
	srand(time(0));
	vector<int>v;
	for (int i = 0; i < n; i++)
	{
		v.push_back(rand() + i);
	}
	int begin = clock();
	for (auto e : v)
	{
		T.insert({ e,e });
	}
	int end = clock();
	cout << end-begin << "ms" << endl;
	cout << T.isbalancetree() << endl;
	T.find(100);
	cout << T.high() << endl;
	cout << T.size() << endl;
}

int main()
{
	test2();
	return 0;
}